package com.yu.dv.autoconfigure;

import com.yu.dv.entity.res.SqlGenerationResponse;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class NaturalLanguageSqlExceptionHandler {

    @ExceptionHandler(Exception.class)
    public SqlGenerationResponse handleException(Exception e) {
        return new SqlGenerationResponse(false, null, "系统错误: " + e.getMessage());
    }
}
